﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace Qero.ChartPoint
{
    [System.Runtime.InteropServices.ComVisible(true)]
    [System.Runtime.InteropServices.Guid("DFE6E03A-69A9-48d5-9AA4-5B04A6ACEDCE")]
    public sealed partial class AppSetControl : UserControl
    {
        private string folderPath;
        private Outlook.Application currApp;

        public AppSetControl()
        {
            InitializeComponent();
        }

#if !INSTALL

        /// <summary> Registers the type as safe for scripting
        /// </summary>
        [System.Runtime.InteropServices.ComRegisterFunction()]
        public static void RegisterServer(Type type)
        {
            RegisterHomepage.RegisterSafeForScripting(type);
        }

        /// <summary> Unregisters the type
        /// </summary>
        [System.Runtime.InteropServices.ComUnregisterFunction()]
        public static void UnregisterServer(Type type)
        {
            RegisterHomepage.UnregisterSafeForScripting(type);
        }

#endif

        public void Initialize(Outlook.Application app, string folderName)
        {
            if (app == null) { return; }

            currApp = app;
            folderPath = folderName;
        }
    }
}
